package com.zr.spring.invoke.test1;

import org.springframework.beans.factory.InitializingBean;

public class Dog implements InitializingBean {
    private String name;
    private int age;

    public Dog() {
        System.out.println("=======执行无参构造函数==========");
    }

    public Dog(String name, int age) {
        System.out.println("=======执行有参构造函数==========");
        this.name = name;
        this.age = age;
    }

    public void init() {
        System.out.println("=======执行init方法==========");
    }

    public void destroy() {
        System.out.println("=======执行destroy方法==========");
    }

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("=======执行有afterPropertiesSet函数==========");
    }

    public void initMethod() {
        System.out.println("调用initMethod方法...");

    }
}
